package com.ruoyi.gateway.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gateway.mapper.MessageFlowLogMapper;
import com.ruoyi.gateway.domain.MessageFlowLog;
import com.ruoyi.gateway.service.IMessageFlowLogService;

/**
 * 消息流水记录Service业务层处理
 *
 * @author 白向阳
 * @date 2025-09-28
 */
@Service
public class MessageFlowLogServiceImpl implements IMessageFlowLogService
{
    @Autowired
    private MessageFlowLogMapper messageFlowLogMapper;

    /**
     * 查询消息流水记录
     *
     * @param id 消息流水记录主键
     * @return 消息流水记录
     */
    @Override
    public MessageFlowLog selectMessageFlowLogById(Long id)
    {
        return messageFlowLogMapper.selectMessageFlowLogById(id);
    }

    /**
     * 查询消息流水记录列表
     *
     * @param messageFlowLog 消息流水记录
     * @return 消息流水记录
     */
    @Override
    public List<MessageFlowLog> selectMessageFlowLogList(MessageFlowLog messageFlowLog)
    {
        return messageFlowLogMapper.selectMessageFlowLogList(messageFlowLog);
    }

    /**
     * 新增消息流水记录
     *
     * @param messageFlowLog 消息流水记录
     * @return 结果
     */
    @Override
    public int insertMessageFlowLog(MessageFlowLog messageFlowLog)
    {
        messageFlowLog.setCreateTime(DateUtils.getNowDate());
        return messageFlowLogMapper.insertMessageFlowLog(messageFlowLog);
    }

    /**
     * 修改消息流水记录
     *
     * @param messageFlowLog 消息流水记录
     * @return 结果
     */
    @Override
    public int updateMessageFlowLog(MessageFlowLog messageFlowLog)
    {
        return messageFlowLogMapper.updateMessageFlowLog(messageFlowLog);
    }

    /**
     * 批量删除消息流水记录
     *
     * @param ids 需要删除的消息流水记录主键
     * @return 结果
     */
    @Override
    public int deleteMessageFlowLogByIds(Long[] ids)
    {
        return messageFlowLogMapper.deleteMessageFlowLogByIds(ids);
    }

    /**
     * 删除消息流水记录信息
     *
     * @param id 消息流水记录主键
     * @return 结果
     */
    @Override
    public int deleteMessageFlowLogById(Long id)
    {
        return messageFlowLogMapper.deleteMessageFlowLogById(id);
    }
}
